const userokname = document.querySelector('#inputuserokName')
const userokpwd = document.querySelector('#inputokpwd')
const userDl = document.querySelector('#iduserdl')
var ulPight = document.querySelector('#navbarright')
console.log(ulPight)
var msguserok = document.querySelector('#msguserok')
utils.on( userDl, 'click', function () {
    const name = userokname.value
          pwd = userokpwd.value
      utils.fetch('./api/user/user-ok.php', {name, pwd}).then( resp => {
        msguserok.innerHTML = resp.list.msg
        if(resp.code === 200) {
            msguserok.classList.add('text-success')
            setTimeout(() => {
                $('#user-ok').modal('hide')
                ulPight.classList.add('userok')
            }, 1000);
        }else{
            msguserok.classList.add('text-danger')
        }
        setTimeout(() => {
            msguserok.innerHTML = '' 
            msguserok.className = 'text-center'

        }, 1000)
      })
       
})
$('#user-ok').on('hidden.bs.modal', function (e) {
    userokname.value = userokpwd.value = ''
  })
